﻿@{
    ViewBag.Title = "ReviewTotal";
    Layout = "~/Views/Shared/_BasicLayout.cshtml";
}

<script type="text/javascript">
    $(function () {
        var height = $("#divTotal").height();
        var master = $("#master").height();
        var content = parseFloat(height) - parseFloat(master) - 30;
        $("#tbList").css("height", content);
    });
</script>
<script type="text/javascript">
    $(function () {
        $("#tbList").datagrid({
            url: '/Review/GetReviewList',
            loadMsg: '数据加载中请稍后……',
            pagination: true,
            rownumbers: true,
            idField: "ID",
            singleSelect: true,
            pageSize: 20,
            pageList: [20, 50, 100],
            queryParams: com.serializeSearchArray("form1"),
            striped: true,
            columns: [[{ field: 'ck', checkbox: true, width: 30 },
             { field: 'RevNum', title: '审批单号 ', align: "center", width: 120 },
                         { field: 'DocName', title: '审批类型 ', align: "center", width: 120 },
                         {
                             field: 'TotalState', title: '状态 ', align: "center", width: 120, formatter: function (value, row, index) {
                                 return com.getArrayText(StaticCombo.reviewState, value);
                             }
                         },
                         { field: 'FillDate', title: '制单时间 ', align: "center", width: 80 },
                         { field: 'AddPerson', title: '制单人 ', align: "center", width: 80 },
                         { field: 'CurrentReviewName', title: '当前审核人', align: "center", width: 120 },
             { field: 'FillDate', title: '填写日期 ', align: "center", width: 100 },
             { field: 'ManClerk', title: '维护人 ', align: "center", width: 100 },
            ]], onDblClickRow: function (rowIndex, rowData) {
                var url = rowData.TotalUrl + "?action=view&reviewId=" + rowData.ID;
                top.wrapper.addTab("查看审批明细", url);
            }
        });
    });
</script>

<script type="text/javascript">

    editRow = undefined;
    editAction = undefined;
    function funcSearch() {
        var para = com.serializeSearchArray("form1");
        $("#tbList").datagrid("load", para);

    }
    //function funcAdd() {
    //    //添加时先判断是否有开启编辑的行，如果有则把开户编辑的那行结束编辑
    //    if (editRow != undefined) {

    //    }
    //    //添加时如果没有正在编辑的行，则在datagrid的第一行插入一行
    //    if (editRow == undefined) {
    //        $("#tbList").datagrid("insertRow", {
    //            index: 0, // index start with 0
    //            row: {

    //            }
    //        });
    //        //将新插入的那一行开户编辑状态
    //        $("#tbList").datagrid("beginEdit", 0);
    //        //给当前编辑的行赋值
    //        editRow = 0;
    //        editAction = "add";
    //    }
    //}
    //function funcEdit() {
    //    var row = $('#tbList').datagrid('getSelected');
    //    if (row) {
    //        if (editRow != undefined) {
    //        }
    //        else {
    //            var index = $("#tbList").datagrid('getRowIndex', row);
    //            //   var index = row.Id;
    //            $("#tbList").datagrid('beginEdit', index);
    //            editAction = "edit";
    //            editRow = index;
    //        }
    //    }
    //    else {
    //        com.message("information", "请选中一行");
    //    }
    //}
    //function funcSave() {
    //    $('#tbList').datagrid('endEdit', editRow);
    //}
    //function funcCancel() {
    //    $('#tbList').datagrid("cancelEdit", editRow);
    //    editRow = undefined;
    //    editAction = undefined;
    //}
    function funcReload() {
        $("#form1").form("reset");
        var para = com.serializeSearchArray("form1");
        $("#tbList").datagrid("load", para);
    }

</script>
<div id="divTotal" style="height: 100%; width: 100%">
    <div id="master" class="container_12" style="height: auto">
        <form id="form1">
            <input id="startFillDate" name="startFillDate" class="easyui-datebox" data-options="prompt:'开始时间'">
            <input id="endFillDate" name="endFillDate" class="easyui-datebox" data-options="prompt:'结束时间'" />
            <input id="DocName" name="DocName" data-cp="co" class="easyui-textbox" data-options="prompt:'审批类型'" />
        </form>
    </div>
    <table id="tbList" title="审批明细表 " style="width: 100%"></table>
</div>
